< previous page page_113 next page >

Page 113
Optional Menu Settings
In addition to the two required properties, each menu item also has several other optional properties that you can use to control the menu item:
Checked determines whether a check mark is displayed next to a menu item when it's selected. This is used to indicate when a particular option has been selected.
If Enabled is False (not selected), users can see the menu item but can't access it.
Visible allows you to hide menu items that aren't needed for a particular function or form.
NegotiatePosition determines whether the top-level menu items are displayed while another form is active and contains its own menu.
WindowList is available only when with MDI applications. It displays a list of the current child windows displayed.
When you want to indicate the status of a particular function, use the Checked property to show a check mark in the menu drop-down list for the item selected. Visual Basic uses this property to show which toolboxes are displayed (see Figure 4.24). This property actually toggles back and forth between True and False within the application code itself.
12181-0113a.gif
Figure 4.24.
Using the Checked property to display
a function's status.
To use the Checked property, you need to add the following code to the Click event of any menu item that you want to use it with:
If <menu item>.Checked then
    <menu item>.Checked = True
Else
    <menu item>.Checked = False
End If

 
< previous page page_113 next page >

If you like this book, buy it!